package cn.csc.module.member.api.browsinghistory;

import cn.csc.framework.common.pojo.CommonResult;
import cn.csc.module.member.api.browsinghistory.dto.ProductBrowsingHistoryRespDTO;
import cn.csc.module.member.convert.browsinghistory.ProductBrowsingHistoryConvert;
import cn.csc.module.member.service.browsinghistory.ProductBrowsingHistoryService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static cn.csc.framework.common.pojo.CommonResult.success;

/**
 * @author 云隐
 * @date 2025/1/3
 **/
@RestController
@Validated
public class ProductBrowsingHistoryApiImpl  implements ProductBrowsingHistoryApi {

    @Resource
    private ProductBrowsingHistoryService productBrowsingHistoryService;

    @Override
    public CommonResult<List<ProductBrowsingHistoryRespDTO>> getProductList() {
        return success(ProductBrowsingHistoryConvert.INSTANCE.convertList03(productBrowsingHistoryService.getProductBrowsingHistoryList()));
    }
}
